package org.auto;

import org.opencv.core.Core;
import org.test.GPSPoint;
import org.test.TraceBoundaryProcessor;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Test1 {

    public static void main(String[] args) throws Exception {

        // 加载 opencv_javaXX.dll
        System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

        List<GPSPoint> traces = new ArrayList<>();

        BufferedReader br = new BufferedReader(new FileReader("data2.txt"));
        String line = null;
        br.readLine(); //跳过标题行
        while ((line = br.readLine()) != null) {
            String[] arr = line.split("\\s+");
            traces.add(new GPSPoint(Double.parseDouble(arr[0]), Double.parseDouble(arr[1])));
        }

        Map<String, Object> map = TraceBoundaryProcessor.getTracesBoundaries(traces, 1, 1, 1, 4000, true, true);
        System.out.println(map);
    }
}
